#include <ros/ros.h>
#include <chat_msgs/chat.h>

int main(int argc, char* argv[])
{
    setlocale(LC_ALL, "zh_CN.utf-8");
    ros::init(argc, argv, "pub_node");
    ros::NodeHandle nh;
    ros::Publisher pub = nh.advertise<chat_msgs::chat>("chat", 10);
    ros::Rate rate(30);
    chat_msgs::chat  msgs;
    msgs.grade = "super";
    msgs.start = 10;
    msgs.data = "hello";
    while (ros::ok())
    {
      pub.publish(msgs);
     rate.sleep();
    }

    return 0;
}